package com.panopset.sf;

import java.awt.Dimension;
import java.awt.Window;

import com.panopset.sf.env.Screener;

/**
 * Frame defaults.
 * @author Karl Dinwiddie
 *
 */
public final class FrameDefaults {


    /**
     * Reset window to defaults.
     * @param w Window to reset.
     */
    public void reset(final Window w) {
        w.setSize(dftFrameDimension);
        w.setLocation(new Screener().centerInScreen(dftFrameDimension));
    }

    /**
     * Default is 500 by 300.
     */
    private static final Dimension DFT = new Dimension(500, 300);

    /**
     * 500 by 300 screen. Change this prior to launch to set a different default
     * screen size.
     */
    private static Dimension dftFrameDimension = DFT;

    /**
     * Set default frame dimension, must be called prior to launch.
     * @param value New value.
     */
    public static void setDftFrameDimension(final Dimension value) {
        dftFrameDimension = value;
    }
}
